import request from '../utils/request.js'

// 通过商品编号查找商品评价
export function getEvaluationByGoodsId(id) {
	return request('evaluation/select/m/goodsId/'+id);
}

// 通过商品号查询商品评价前两条
export function getEvaluationTop2ByGoodsId(id) {
	return request('/evaluation/select2/m/goodsId/'+id);
}

// 通过民宿编号查找评价
export function getEvaluationByHomestayId(id) {
	return request('evaluation/select/homestayid/'+id);
}

export function createEvaluationByOrderId(orderId,evaluation) {
	console.log("orderId: ",orderId);
	console.log("evaluation: ",evaluation);
	return request('evaluation/insert?evaluationOrderId='+orderId+
	'&evaluationStar='+evaluation.evaluationStar+'&evaluationContent='+evaluation.evaluationContent)
	
}

